<template>
  <div>
    <Editor v-model="Essay.titleContent" theme="light" previewOnly="true" />
  </div>
</template>

<script setup>
import { onMounted, ref } from "vue-demi";
import { useRoute } from "vue-router";
import { getTitleById } from '@/api/title'
import Editor from 'md-editor-v3'
import 'md-editor-v3/lib/style.css';
const route = useRoute()
const id = route.query.essayId
const Essay = ref([])

const test = onMounted(() => {
  console.log(Essay.value.titleContent);
})

onMounted(() => {
  getTitleById(id).then((res) => {
    Essay.value = res.data
    console.log(Essay.value.titleContent)
  })
})
</script>

<style>
</style>